/*
 * @(#)CommonMod.java 2011-12-09
 *
 * Copyright 2011 北龙中网（北京）科技有限责任公司. All rights reserved.
 */
package cn.shangjia.shop.controller.mod;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.shangjia.common.domain.CompanyBasicOnline;
import cn.shangjia.common.domain.CompanyInfo;
import cn.shangjia.common.util.StringUtils;
import cn.shangjia.search.common.bean.SolrCompanyInfo;
import cn.shangjia.shop.controller.base.AbstractController;
import cn.shangjia.shop.service.CompanyInfoService;
import cn.shangjia.shop.service.SolrQueryService;

/**
 *
 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
 * @version 1.0, 2011-12-09 13:57:34
 * @since 1.0
 */
@Controller
public class CommonMod extends AbstractController{
	
	@Resource
	private SolrQueryService solrQueryService;
	
	@Resource
	private CompanyInfoService companyInfoService;
	
	/**
	 *  商铺标题
	 * 
	 * @param model
	 * @param userid
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/mod_headerBanner.html")
	public void mod_headerBanner(ModelMap model){
		
	}
	
	/**
	 *  商铺导航条
	 * 
	 * @param userid
	 * @param username
	 * @param model
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/mod_headerNavigat.html")
	public void mod_headerNavigat(ModelMap model){
		
	}
	
	/**
	 *  商铺底部
	 * 
	 * @param model
	 * @param userid
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/mod_footer.html")
	public void mod_footer(ModelMap model){
		
	}
	
	/**
	 *  主题图片页展示 
	 * 
	 * @param model
	 * @param userid
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/mod_bigPic.html")
	public void mod_bigPic(ModelMap model){
		
	}
	
	/**
	 *  友情链接 
	 * 
	 * @param model
	 * @param userid
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/mod_fLink.html")
	public void mod_fLink(ModelMap model, String userid){
		if (StringUtils.isEmpty(userid))
			return;
		CompanyInfo info = companyInfoService.getCompanyInfoByUserId(userid);
		if (info == null)
			return;
		CompanyBasicOnline basic = info.getCompanyBasicOnline();
		 List<SolrCompanyInfo> fLink = solrQueryService.findFriendLink(basic.getBrand(), basic.getGbt());
		model.addAttribute("fLink", fLink);
	}
	
	/**
	 *  页面 JS 动态加载
	 * 
	 * @param model
	 * @param userid
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/js.html")
	public void js(ModelMap model){
		
	}
	
	/**
	 *  页面 CSS 动态加载
	 * 
	 * @param model
	 * @param userid
	 * @return
	 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
	 */
	@RequestMapping("/shop/module/common/css.html")
	public void css(ModelMap model){
		
	}
	
	
}
